#pragma once

namespace Melting
{
	template <typename T>
	class BitField
	{ 
	public:

		T		miBits;

		BitField( void ) 
		: miBits( 0 )
		{}

		bool	IsSet( int _iBitID ) const
		{
			return 0 != (miBits & ( 1 << _iBitID ));
		}

		void	SwitchOn( int _iBitID )
		{
			miBits = miBits | ( 1 << _iBitID );
		}

		void	SwitchOff( int _iBitID )
		{
			miBits = miBits & ~( 1 << _iBitID );
		}

		void	Toggle( int _iBitID )
		{
			miBits = miBits ^( 1 << _iBitID );
		}
	};
	typedef BitField< UINT8 >	BitField8;
	typedef BitField< UINT16 >	BitField16;
	typedef BitField< UINT32 >	BitField32;

}